﻿README File for Replicating Analysis for Seljan and Gronke, “Happy Birthday! You Get to Vote!”


By: Ellen Seljan and Paul Gronke
Date of this Readme: August 29, 2022


1. General instructions:
   1. All scripts are written in R and were executed in R-Studio
      1. R Version 4.2.0
      2. All packages were current versions as of August 2022
         1. Sjplot 2.8.11
         2. AER 1.2-10
         3. Tidyverse 1.3.1
         4. Lubridate 1.8.0
         5. Margins 0.3.26
         6. Equivtest (see  special instructions below)
         7. Ivpack (see special instructions below)
         8. doBy 4.6.13
         9. Mosaic 1.8.3
         10. Splitstackshape 1.4.8
         11. Stargazer 5.2.3

   2. Platform: 
   1. Scripts are platform independent.
   2. Authors ran scripts on macOS Monterey with 16 GB RAM

      2. Specialized instructions for R Packages:
      1. R Package “ivpack” used for instrumental variables analysis
      1. Package documentation: https://rdrr.io/cran/ivpack/#vignettes
      2. Package was archived on CRAN as of 6/20/2022
      3. To install: 
      1. library(devtools)
      2. install_version(“ivpack”, version = “1.2”)

         2. R Package “eqivtest” used for equivalence tests for placebo treatments. 
         1. Package documentation: https://github.com/ekhartman/equivtest
         2. To install:
         1. library(devtools)
         2. install_github(“ekhartman/equivtest”)

            3. Step by Step Instructions for Replication
            1. All scripts are contained in the root directory
            2. To do a complete replication
            1. Purchase unanonymized voter lists from the Division of Elections in California and Oregon. These files were not distributed with this replication archive in the interests of protecting voter privacy. 
            2. Execute:
            1. PSRM-AVR-CA-origination-anon.R
            2. PRSM-AVR-replication-code-file-origination-OR2016.R
            3. PSRM-AVR-replication-code-file-origination-OR2018.R
            3. These files output, respectively:
            1. “California/CA2018_anon.rds”
            2. “Oregon/OR2016_anon.RDS”
            3. “Oregon/OR2018_anon.RDS”

            4. These files contain all data elements used to perform the analysis in the paper as well as voter IDs and other information that can be used to confirm that these are the original files but with personally identifiable information removed (e.g. First, Middle, Last Names, Addresses). 

               3. To Replicate Analysis
               1. Step One: Run the Oregon 2016 Analysis: 
               1. “PSRM AVR OR 2016 Replication.R”
               2. Log: “PSRM AVR OR 2016 Replication_log.txt”
               2. Step Two: Run the Oregon 2018 Analysis
               1. “PSRM AVR OR 2018 Replication.R”
               2. Log: “PSRM AVR OR 2018 Replication_log.txt”
               3. Step Three: Run the California 2018 Analysis
               1. “PSRM-AVR-CA-analysis.R”
               2. Log: “PSRM-AVR-CA-analysis_log.txt”
               4. Step Four: Create Combined Tables
               1. “PSRM Happy Birthday Combined Tables Replication.R”
               2. Log: “AVR_combined_tables_log.txt”